<?php
class Link extends AppModel{
    public $useTable  = 'link';
    public $primaryKey  = 'link';
    //public $primaryKeyArray = array('link','lang_code');
    
    function add($data = array())
    {
        if(empty($data))
            return null;
            
        $link = @$data['link'];
        $controller = @$data['controller'];
        $method = @$data['method'];
        $post_id = @$data['post_id'];
        $type = @$data['type'];
        $lang_code = @$data['lang_code'];
        
        $sql = "INSERT INTO link values('$link', '$controller', '$method', '$post_id', '$type', '$lang_code')";
		return $this->query($sql);
    }
    
    function add_bk($data = array())
    {
        if(empty($data))
            return null;
            $this->create();
		return $this->save($data);
    }
    

}